<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .left,.right{
            width: 100px;
            height: 100px;
            float: left;
        }

        .left{
            background: yellow;
        }
        .right{
            background-color: red;
        }
        .content{
            width: 200px;
            height: 200px;
            background-color: green;
        }
        /* .box{
            height: 100px; 如果浮动过多，换行就会出现问题
        } */
        .box{
            overflow: hidden;
        }
    </style>
</head>
<body>
      <div class="box">
          <div class="left"></div>
          <div class="right"></div>
          <!-- <div style="clear: both;"></div>  增加空标签，不利代码可读性，降低浏览器性能。 -->
      
        </div>

      <div class="content"></div>
</body>
</html>